package com.cby.android.sample.model

import android.app.Application
import com.cby.android.library.base.BasePageStateViewModel
import com.cby.android.sample.bean.tianxing.TXWxNewArticleBean
import com.cby.android.sample.repository.TianXingApiImpl
import com.cby.android.sample.repository.api.ApiSource

/**
 * @description: WxNewListViewModel
 * @author: ChenBaoYang
 * @createDate: 2022/5/9 1:50 下午
 */
class TxWxNewListViewModel(application: Application): BasePageStateViewModel<TXWxNewArticleBean>(application) {

    private var tianXingApi = TianXingApiImpl()

    private var num: Int = 10


    override suspend fun loadPageData(page: Int): MutableList<TXWxNewArticleBean> {
        val response = tianXingApi.loadWxNewArticleList(ApiSource.TIAN_XING_API_KEY, num, page)
        return response.newslist
    }
}